/**
 * Created by Administrator on 2017/3/15 0015.
 */
import React from 'react';

const empty = require('is-empty');
class CountupItem extends React.Component{

  render(){
    let end;
    if(empty(this.props.end)) {
      end = 0;
    }else {
      end = this.props.end.toFixed(this.props.decimals);
    }
    return (
      <span className={this.props.className}>
        {`${empty(this.props.prefix)?'':this.props.prefix}${end}${empty(this.props.suffix)?'':this.props.suffix}`}
      </span>
    );
  }
}
export default CountupItem;
